package org.yzh.rbac.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.yzh.rbac.mapper.RoleMapper;
import org.yzh.rbac.model.entity.RoleDO;

import java.util.List;

@Service
public class RoleService {

    @Autowired
    private RoleMapper roleMapper;

    public List<RoleDO> find(RoleDO entity) {
        List<RoleDO> result = roleMapper.find(entity);
        return result;
    }

    public RoleDO get(Integer id) {
        RoleDO result = roleMapper.get(id);
        return result;
    }

    public int add(RoleDO entity) {
        int row = roleMapper.insert(entity);
        return row;
    }

    public int update(RoleDO entity) {
        int row = roleMapper.update(entity);
        return row;
    }

    public int delete(Integer id) {
        int row = roleMapper.delete(id);
        return row;
    }
}